<%@ include file = "/common/ini.jsp"%>
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/common/_ApplicationContext_init.jsp"%>
<%@ include file = "/common/_currUser_Infor.jsp"%> 
<html>
<head>
<link rel="stylesheet" href="<%= WebPath%>/css/style.css">
<link href="css/xtree.css" rel="stylesheet" type="text/css">
</head>
<body background="<%= WebPath%>/common/navbar/images/bg.gif" onresize="javascript:location.reload();">
<%@ include file = "/common/navbar/_navbar_config_js.jsp"%>
<script>
<%
    List columns = currUser.getColumns();
    logger.info("共有被授权的栏目个数为: " + columns.size());
    Map codes = new HashMap();
    Set c1Ids = new LinkedHashSet();
    // 一级栏目
    int c1sIndex = 0;
    for(int i = 0; i < columns.size(); i ++)
    {
        Column c1 = (Column)columns.get(i);
        if(c1.getType() == ColumnType.ONE_LEVEL 
        && c1.getArea().getCode().equals(ViewFrameParams.DEFAULT_HOME_FUNC_AREA))
        {
            logger.debug("一级栏目: " + c1.getName());
            StringBuffer sb = new StringBuffer(200);
            c1sIndex ++;
            sb.append("OutBarFolder" + c1sIndex + " = new Array('" + c1.getName() + "',");
            codes.put(c1.getId(),sb);
            c1Ids.add(c1.getId());
        }// 1
    } // for i
    // 二级栏目
    for(int i = 0; i < columns.size(); i ++)
    {
        Column c2 = (Column)columns.get(i);
        if(c2.getType() == ColumnType.TWO_LEVEL
        && c2.getSuperColumn().getArea().getCode().equals(ViewFrameParams.DEFAULT_HOME_FUNC_AREA))
        {
            logger.debug("二级栏目: " + c2.getName());
            StringBuffer sb = (StringBuffer)codes.get(c2.getSuperColumn().getId());    
            if(sb != null)
            {
                sb.append("'" + WebPath + "/logo/images/" + c2.getImageUrl() + "','" + c2.getName() + "','"+ WebPath + "/" + c2.getUrl() + "','parent.home',");
            }
        }// 1
    } // for i

    // 打印
    Object[] ids = c1Ids.toArray();
    for(int i = 0; i < ids .length; i ++)
    {
        StringBuffer sb = (StringBuffer)codes.get(ids[i]);
        String s = sb.toString();
        out.print(s.substring(0,s.length() - 1) + ");");
    }
%>

</script>
<TABLE cellSpacing=0 cellPadding=0 border=0 width=123>
  <tr> 
    <td valign=top>
        <SCRIPT LANGUAGE="JAVASCRIPT">
        try 
        {
        if (document.all)
        {
                document.write('<script src="<%= WebPath%>\/common\/navbar\/_outbar_js.js"><\/script>');
        }
        }catch(error) { }
        </SCRIPT>
    </td>
  </tr>
</table>
</BODY>
</html>
